package com.sk.wordandpdf;

import com.alibaba.fastjson.JSON;

/**
 * 读取pdf和word文档
 */
public class Test {
    public static void main(String[] args) {
        String str = WordUtil.getTextFromWord("/Users/suke/Documents/测试文档.docx");
        System.out.println(str);
        ExtractorBody body = ContentExtractor.extractor(str);
        System.out.println(JSON.toJSONString(body));


//        String pdfStr = PdfUtil.getTextFromPdf("/Users/suke/Downloads/Netty实战.pdf");
//        System.out.println(pdfStr);
//        ExtractorBody body = ContentExtractor.extractor(pdfStr);
//        System.out.println(JSON.toJSONString(body));


    }

}
